/**
 * 
 */
package cn.bblocks.cacheTest.model.dao;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;



import cn.bblocks.cacheTest.model.UserBank;


/**
 * @author Administrator
 *
 */

public interface UserBankMapper extends JpaRepository<UserBank, Integer>{
	
	List<UserBank> findByIdcardseqnoAndStatusOrderByIdDesc(Integer idcardseqno,Integer status);
	
	

	
	
	@Query(value = "SELECT b.* FROM user_bank b  where b.idcardseqno= :idcardseqno and b.status=1 order by b.id desc",
	  countQuery = "SELECT count(*) FROM user_bank b  where b.idcardseqno= :idcardseqno and b.status=1",
	  nativeQuery = true)
	Page<UserBank>  findUserBanksByPage(@Param("idcardseqno")Integer idcardseqno
			, Pageable pageable);
	
	


}
